import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

import java.util.Scanner;

abstract class Employee {
    //Manager 固定工资
    //Salesman 基础工作+销售提成
    //Worker 工作天数计算工资
    private String name;
    private String work;
    public Employee(String name,String work) {
        this.name=name;
        this.work=work;
    }
    //计算工资
    abstract public String ComputerSalary();

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
}
class Manager extends Employee {
    public Manager(String name, String work) {
        super(name, work);
    }
    @Override
    public String ComputerSalary() {
        int salary = 10000;
        return this.getName()+"经理的本月工资是->"+salary;
    }
}

class Salesman extends Employee {
    public Salesman(String name, String work) {
        super(name, work);
    }
    @Override
    public String ComputerSalary() {
        int salary=3000;
        //计算提成
        System.out.println(getName()+"本月卖出了多少单：");
        int num=new Scanner(System.in).nextInt();
        salary+=num*100;
        return this.getName()+"的本月工资是->"+salary;
    }
}

class Worker extends Employee {
    public Worker(String name, String work) {
        super(name, work);
    }
    @Override
    public String ComputerSalary() {
        int salary = 0;
        System.out.println(getName()+"本月工作了多少天：");
        int num = new Scanner(System.in).nextInt();
        salary += num*180;
        return this.getName()+"工人的本月工资是->"+salary;
    }
}
public class Main {
    public static void main(String[] args) {
        Manager W1 = new Manager("张三","经理");
        System.out.println(W1.ComputerSalary());

        Salesman W2 = new Salesman("李四","销售");
        System.out.println(W2.ComputerSalary());

        Worker W3 = new Worker("王五","工人");
        System.out.println(W3.ComputerSalary());
    }
    public void Money_give() {
    }
}

